import * as vite from "vite";
import { defineConfig as baseConfig, mergeConfig } from "vite";
import { getAliases } from "./paths";
const viteConfig = {
    server: {
        host: true,
    },
    resolve: {
        alias: getAliases(),
    },
    define: {
        "process.env": process.env,
    },
    css: {
        preprocessorOptions: {
            less: {
                javascriptEnabled: true,
            },
        },
    },
};
// redefine defineConfig
const defineConfig = (config = {}) => {
    if (typeof config === "function") {
        return baseConfig((params) => mergeConfig(viteConfig, config(params)));
    }
    return mergeConfig(viteConfig, config);
};
export { defineConfig, mergeConfig, vite };
